/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.entities;

import br.com.deployment.enums.TypeQuestionnaire;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author roniere
 */
/**
 * Formulario Reposta
 *
 * @author roniere
 */
@Entity
public class QuestionnaireResponse implements Serializable {

    @Id
    @SequenceGenerator(name = "seq_qresponse", sequenceName = "seq_qresponse", allocationSize = 1)
    @GeneratedValue(generator = "seq_qresponse", strategy = GenerationType.SEQUENCE)
    private Long id;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateQ;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dataCad;
    @Column
    private String name;
    @Column
    private Long cod;
    @OneToOne
    private Questionnaire questionnaire;
    @OneToMany
    private List<Response> response;
    @OneToOne
    private Executor executor;
    @OneToOne
    private NotaryOffice notaryOffice;
    @Column
    private boolean states;
    @Enumerated(EnumType.ORDINAL)
    private TypeQuestionnaire type;
    
    @Column
    private String conclusion;
    @Column
    private String grounds;
    @Column
    private int score;
    @OneToMany(cascade = CascadeType.ALL)
    private List<Anexo> anexo;

    public QuestionnaireResponse() {
    }

    public Long getId() {
        return id;
    }

    public Long getCod() {
        return cod;
    }

    public void setCod(Long cod) {
        this.cod = cod;
    }

    public List<Anexo> getAnexo() {
        return anexo;
    }

    public void setAnexo(List<Anexo> anexo) {
        this.anexo = anexo;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getDateQ() {
        return dateQ;
    }

    public void setDateQ(Date dateQ) {
        this.dateQ = dateQ;
    }

    public Questionnaire getQuestionnaire() {
        return questionnaire;
    }

    public void setQuestionnaire(Questionnaire questionnaire) {
        this.questionnaire = questionnaire;
    }

    public Executor getExecutor() {
        return executor;
    }

    public void setExecutor(Executor executor) {
        this.executor = executor;
    }

    public NotaryOffice getNotaryOffice() {
        return notaryOffice;
    }

    public void setNotaryOffice(NotaryOffice notaryOffice) {
        this.notaryOffice = notaryOffice;
    }

    public boolean isStates() {
        return states;
    }

    public void setStates(boolean states) {
        this.states = states;
    }

    public Date getDataCad() {
        return dataCad;
    }

    public void setDataCad(Date dataCad) {
        this.dataCad = dataCad;
    }

    public List<Response> getResponse() {
        return response;
    }

    public void setResponse(List<Response> response) {
        this.response = response;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final QuestionnaireResponse other = (QuestionnaireResponse) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    public TypeQuestionnaire getType() {
        return type;
    }

    public void setType(TypeQuestionnaire type) {
        this.type = type;
    }

    public String getConclusion() {
        return conclusion;
    }

    public void setConclusion(String conclusion) {
        this.conclusion = conclusion;
    }

    public String getGrounds() {
        return grounds;
    }

    public void setGrounds(String grounds) {
        this.grounds = grounds;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "QuestionnaireResponse{" + "id=" + id + ", dateQ=" + dateQ + ", dataCad=" + dataCad + ", name=" + name + ", cod=" + cod + ", questionnaire=" + questionnaire + ", response=" + response + ", executor=" + executor + ", notaryOffice=" + notaryOffice + ", states=" + states + ", type=" + type + ", conclusion=" + conclusion + ", grounds=" + grounds + ", score=" + score + '}';
    }
}
